<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改货品分类信息</title>
<link href="<%=path%>/css/style_min.css" rel="stylesheet" type="text/css"/>
<link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<form name="productForm" id="productForm"
		action="<%=path%>/product/product/update.t4m" class="form"
		method="post">
		<s:hidden name="product.id" />
		<div class="form-group">基本信息</div>
		<table class="form-table" cellspacing="0" cellpadding="0">
			<tr>
				<td class="form-left"><span class="form-required">*</span>货品编号</td>
				<td class="form-right"><s:textfield id="code"
						name="product.code" cssClass="text" theme="simple" readonly="true"/></td>
				<td class="form-left"><span class="form-required">*</span>货品名称</td>
				<td class="form-right"><s:textfield id="name"
						name="product.name" cssClass="text required" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left"><span class="form-required">*</span>品牌名称</td>
				<td class="form-right"><s:textfield id="brand"
						name="product.brand" cssClass="text" theme="simple" /></td>
				<td class="form-left"><span class="form-required">*</span>规格型号</td>
				<td class="form-right"><s:textfield id="standard"
						name="product.standard" cssClass="text required" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left"><span class="form-required">*</span>所属类别</td>
				<td class="form-right"><s:select name="product.productType.id"
						cssStyle="width:140px" list="productTypeList" listKey="id"
						listValue="name"
						headerKey="%{@org.team4.constants.StringConstant@ROOT_ID}"
						headerValue="请选择" theme="simple" /></td>
				<td class="form-left"><span class="form-required">*</span>价格单位</td>
				<td class="form-right"><s:textfield id="priceUnit"
						name="product.priceUnit" cssClass="text required" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left">普通价格</td>
				<td class="form-right"><s:textfield id="normalPrice"
						name="product.normalPrice" cssClass="text" theme="simple" /></td>
				<td class="form-left">会员价格</td>
				<td class="form-right"><s:textfield id="discountPrice"
						name="product.discountPrice" cssClass="text" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left">VIP价格</td>
				<td class="form-right"><s:textfield id="vipPrice"
						name="product.vipPrice" cssClass="text" theme="simple" /></td>
				<td class="form-left">税率</td>
				<td class="form-right"><s:textfield id="tax"
						name="product.tax" cssClass="text" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left"><span class="form-required">*</span>生产商</td>
				<td class="form-right"><s:textfield id="manufacturer"
						name="product.manufacturer" cssClass="text required" theme="simple" /></td>
				<td class="form-left"><span class="form-required">*</span>产地</td>
				<td class="form-right"><s:textfield id="address"
						name="product.address" cssClass="text required" theme="simple" /></td>
			</tr>
			<tr>
				<td class="form-left">备注</td>
				<td class="form-right" colspan="3"><s:textarea
						cssStyle="width:385px; height:70px;" cssClass="textarea"
						id="remark" name="product.remark" theme="simple" /></td>
			</tr>
		</table>
		<s:hidden name="tabId" />
		<s:hidden name="windowPanelId" />
	</form>
    <script src="<%=path%>/js/prototype_for_validation.js" type="text/javascript"></script>
    <script src="<%=path%>/js/validation_cn.js" type="text/javascript"></script>
	<script src="<%=path%>/js/core.js" type="text/javascript"></script>
	<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
	<script src="<%=path%>/js/Validate.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			var valid = new Validation('productForm',{immediate:true});
		});
		
		function uniqueValidate(obj) {
			$.ajax({
			      url : "<%=path%>/product/product/uniqueValidate.t4m",
			      data : 'key=' + obj.id + "&value=" + obj.value,
			      async : false,
			      success : function(unique) {
			    	alert(unique);
			        if(unique) {
			          alert("编号已存在！");
			          obj.fucos();
			        }
			      }
			    });			
		}
	</script>
</body>
</html>